home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Agent Central Host Computer
/
Agent - Central Host Computer.iso
/
_SETUP.1
/
vprevinsert.sql
< prev
next >
Wrap
Text File
|
2000-05-12
|
756b
|
21 lines
/*
This view determines the most recent previous insert date and time for a given cashbox into a particular farebox.
*/
create or replace view vprevinsert as
select vcurstaterange.conversion_num,
vcurstaterange.farebox_glid,
vcurstaterange.close_count,
vcurstaterange.cashbox_glid,
vcurstaterange.conv_date,
cbinsert.conv_date insert_date
from vcurstaterange, cbinsert
where vcurstaterange.farebox_glid = cbinsert.farebox_glid and
cbinsert.cashbox_glid = vcurstaterange.cashbox_glid and
cbinsert.conv_date = (select max(cbi2.conv_date)
from cbinsert cbi2
where cbi2.conv_date < vcurstaterange.conv_date and
cbi2.cashbox_glid = cbinsert.cashbox_glid and
cbi2.farebox_glid = vcurstaterange.farebox_glid);